<?php

class Template extends Smarty {
	public function __construct($template = null, $options = array()) {
		parent::__construct();
		
		$path = isset($options['path']) ? $options['path'] : 'templates/';
		
		$template_dir = $path . $template . '/';
		
		$smarty_vars = array(
			'template_dir' => $template_dir,
			'compile_dir' => $template_dir . '/compile/',
			'config_dir' => $template_dir . '/cache/',
			'debugger' => false
		);
		
		foreach ($smarty_vars as $name => $value) {
			$this->{$name} = $value;
		}
	}
}

?>